/**
 * @Classname SmsMetaObjectHandler
 * @Description mybatis-plus 自动填充功能
 * @author Tale-Mi
 * @date 2019/2/3 14:50
 */
package org.tale.mscp.sms.aliyun.handler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
public class SmsMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        LocalDateTime now = LocalDateTime.now();
        this.setFieldValByName("createDate", now, metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
